<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<meta name="keywords" content="别墅工场-收货地址">
<meta name="description" content="别墅工场-收货地址">
<title>收货地址</title>
<link rel="stylesheet" href="/index/css/style.css">
<link rel="stylesheet" href="/index/css/responsive.css" />
<script src="/public/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="/index/js/jquery.slide.js"></script>
<script type="text/javascript" src="/index/js/addons.js" ></script>
<script type="text/javascript" src="/index/js/user.js" ></script>
<!--[if lt IE 9]>
<script src="/index/js/html5/js"></script>
<![endif]-->
</head>
<body style="background: #f8f8f8;" onkeydown="on_return()">
<div class="Uppermost">
	<div class="wrapper">
		<div class="clearfix">
			欢迎光临湖南森态建筑设计有限责任公司！
			{empty name='user_info.user_id'}<div class="fr"><a href="javascript:;" id="user_login">登陆<span>|</span>注册</a></div>{/empty}{notempty name='user_info.user_id'}<div class="fr"><a href="javascript:;">别墅工场欢迎您！</a></div>{/notempty}
		</div>
		<p><a href="/about">关于我们</a><span>|</span>{empty name='user_info.user_id'}<a href="javascript:;" class="user_login">个人中心</a>{/empty}{notempty name='user_info.user_id'}<a href="/userInfo" >个人中心</a>{/notempty}<span>|</span><a href="/sitemap.html">网站地图</a></p>
	</div>
</div>
<div class="header">
	<div class="wrapper">
		<div class="img fl">
			<a href="#">
				<img src="/index/img/u33.png"/>
			</a>
		</div>
		<div class="nav fl">
			<ul class="clearfix">
				<li  class="on"><a href="/">网站首页</a></li>
				<li><a href="/bieshusheji">别墅图纸</a></li>
				<li><a href="/tuandui">设计团队</a></li>
				<li><a href="/dingzhi">私人定制</a></li>
				<li><a href="/ordercase">案例展示</a></li>
				<li><a href="/news">建房知识</a></li>
			</ul>
		</div>
		<div class="fr inp">
			<label>
				<form>
					<input type="text" id="keyword_name" placeholder="输入图纸编号或是关键字"/>
				</form>
				<button id="searchButton" onclick="search()"></button>
			</label>
		</div>
	</div>
</div>
<!--conter -->
<div class="cut wrapper">
	<a href="/">首页</a><span>></span>用户中心<span>></span><i style="color: #FFC000;">收货地址</i>
</div>
<div class="contert-box wrapper clearfix">
	<div class="left-box fl">
		<div class="box">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/orderRecord"><img src="/index/img/u5446.png" class="a"/><img src="/index/img/u5446_on.png" class="b" />我的订单</a></li>
				<!--<li><a href="#"><img src="index/img/u5444.png" class="a"/><img src="index/img/u5444_on.png" class="b"/>我的收藏</a></li>-->
				<li><a href="/browseRecord"><img src="index/img/u5442.png" class="a"/><img src="index/img/u5442_on.png" class="b"/>浏览记录</a></li>
				<!--<li><a href="#"><img src="index/img/u5448.png" class="a"/><img src="index/img/u5448_on.png" class="b"/>促销优惠</a></li>-->
				<li><a href="/receiverAddress"><img src="index/img/u5452.png" class="a"/><img src="index/img/u5452_on.png" class="b"/>收货地址</a></li>
				<li><a href="/userInfo"><img src="index/img/u5458.png" class="a"/><img src="index/img/u5458_on.png" class="b"/>个人资料</a></li>
			</ul>
		</div>
		<div class="box">
			<h3>客服热线</h3>
			<div class="text">
			<div class="tel">
				<h5>订购/咨询热线：</h5>
				<h4>400-9020-868：</h4>
				<h5>售后服务热线：</h5>
				<h4>0731-88576861：</h4>
			</div>
			</div>
		</div>
		<div class="box">
			<h3>客服热线</h3>
			<div class="qr">
			<img style="width: 150px;" src="/index/img/bieshulogo.jpg" />
			</div>
		</div>
	</div>
	<div class="right-box fr" style="height: auto;">
		<h6>基本资料</h6>
		<div class="data">
			<form>
			<ul>
				<li class="clearfix">
					<h5 class="fl">地区选择：</h5>
					<div class="fl select">
						<select name="shen" id="shen">
							<option value="">请选择省</option>
							{volist name='shengList' id='info'}
							<option value="{$info.id}">{$info.name}</option>
							{/volist}
						</select>
						<select name="shi" id="shi">
							<option value="">请选择市</option>
						</select>
						<select name="xian" id="xian">
							<option value="">请选择县/区</option>
						</select>
					</div>
				</li>
				<li class="clearfix">
					<h5 class="fl">详细地址：</h5>
					<div class="inps fl">
						<textarea type="text" id="address"></textarea>
					</div>
				</li>
				<li class="clearfix">
					<h5 class="fl">收货人姓名：</h5>
					<div class="inps fl">
						<input type="text" id="name" />
					</div>
				</li>
				<li class="clearfix">
					<h5 class="fl">手机号码：</h5>
					<div class="inps fl">
						<input type="text" id="tel"/>
					</div>
				</li>
			</ul>
			</form>
			<div class="checkbox clearfix">
				<label><input type="checkbox" id="check_address"/><span>设置为默认收货地址</span></label>
			<div class="fl"><button onclick="info_submit()">提交</button></div>
			</div>
		</div>
		<div class="tables">
			<table>
				<tr>
					<th>收货人</th>
					<th class="width3">详细地址</th>
					<th class="width3">详细地址</th>
					<th>电话/手机</th>
					<th>操作</th>
					<th></th>
				</tr>
				{volist name='addressList' id='info'}
				<tr>
					<td>{$info.nick_name}</td>
					<td>{$info.sheng_name}{$info.shi_name}{$info.xian_name}</td>
					<td>{$info.address}</td>
					<td>{$info.tel}</td>
					<td><span onclick="editAddress({$info.address_id})">修改</span><i>|</i><span onclick="deleteAddress({$info.address_id})">删除</span></td>
					<td>{notempty name='info.default'}<p>默认地址</p>{/notempty}{empty name='info.default'}<p style="border: 1px solid #eee;color: #333;">收货地址</p>{/empty}</td>
				</tr>
				{/volist}
			</table>
		</div>
	</div>
</div>
<!--conter end-->
<!--footer -->
{include file="/public/bottom" /}
<!--footer end-->
{include file="public/comscript" /}
</body>
</html>
<script>
    $("#check_address").val(0);

    $("#shen").change(function(){
        var url = "addressList";
        var opt=$("#shen").val();
        address_post_sub(url,{id:opt},$('#shi'));
        $("#address").val($('#shen').find("option:selected").text());
    });
    $("#shi").change(function(){
        var url = "addressList";
        var opt=$("#shi").val();
        address_post_sub(url,{id:opt},$('#xian'));
        $("#address").val($('#shen').find("option:selected").text()+$('#shi').find("option:selected").text());
    });
    $("#xian").change(function(){
        $("#address").val($('#shen').find("option:selected").text()+$('#shi').find("option:selected").text()+$('#xian').find("option:selected").text());
    });
    $("#check_address").change(function() {
        if($("#check_address").val()=='0'){
            $("#check_address").val(1);
		}else {
            $("#check_address").val(0);
		}
    });
    //删除地址
    function deleteAddress($address_id) {
        layer.confirm('确定要删除该地址吗？', {
            area:["300px","180px"],
            btn: ['确定', '取消']
            ,btn2: function(index, layero){
                //按钮【按钮二】的回调
            }
        },function(index){
            //按钮【按钮一】的回调
            $.ajax({
                type :"POST",
                url : __HOME__+"deleteAddress",
                data:{
                    "address_id":$address_id,
                },
                async : true,
                dataType:'json',
                success : function(result) {
                    window.location.href = __HOME__+"receiverAddress";
                },
                error : function() {
                    layer.alert('当前网络可能较差请稍后再试!',{icon: ""},function(index){
                        layer.close(index);
                    });
                }
            });
        });
    }
	//修改地址
	function editAddress($address_id) {
        layer.open({
            type: 2,
            title: "修改地址",
            area: ["500px", "550px"],
            skin: 'layui-layer-rim',
            fixed: false, //不固定
            resize: false,
            zIndex: 999999999,
            content: "index/users/editAddress?id="+$address_id,
            shadeClose: true,
            end: function () {
                location.reload();
            }
        });
    }


</script>
